<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/12/15/015
 * Time: 17:14
 */

namespace app\portal\controller;


use cmf\controller\AdminBaseController;
use think\Db;

class BigDataController extends AdminBaseController
{
    /**
     * 大数据
     */
    public function index()
    {
        $data = Db::name('big_data')->where('id','=',72)->find();
        $this->assign('data',$data);
        return $this->fetch();
    }

    /**
     * 修改大数据
     */
    public function editData()
    {
        if ( $this->request->isPost() ) {
            $data['data_people_day'] = input('post.data_people_day');
            $data['data_people'] = input('post.data_people');
            $data['data_download'] = input('post.data_download');
            $data['data_order'] = input('post.data_order');
            $result = Db::name('big_data')->where('id','=',72)->update($data);
            if ( $result ) {
                $this->success('修改成功!');
            }
            else {
                $this->error('修改失败');
            }
        } else {
            $this->error('提交的方式有误');
        }
    }
}